<template>
  <div id="app">
    <a-config-provider
      :locale="locale"
      :autoInsertSpaceInButton="false"
      :transformCellText="handleEmptyData"
    >
      <router-view />
    </a-config-provider>
  </div>
</template>

<script>
import { ConfigProvider } from "ant-design-vue";
import zhCN from "ant-design-vue/es/locale/zh_CN";
import moment from "moment";
import "moment/locale/zh-cn";

moment.locale("zh-cn");
export default {
  components: {
    "a-config-provider": ConfigProvider,
  },
  data () {
    return {
      locale: zhCN,
    };
  },
  methods: {
    /** 处理空数据 */
    handleEmptyData: function ({ text }) {
      if (text === "" || typeof text === "undefined" || text === null) {
        return "--";
      } else {
        return text;
      }
    },
  },
};
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}
</style>
